package com.zhida.blogservice.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;

import lombok.*;

/**
 * <p>
 * 
 * </p>
 *
 * @author ling
 * @since 2024-07-29
 */
@TableName("likes_log")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LikesLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "like_id", type = IdType.AUTO)
    private Integer likeId;

    /**
     * 用户名
     */
    @TableField("username")
    private String username;

    /**
     * 点赞时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 对象id：博客id，评论id...
     */
    @TableField("obj_id")
    private Integer objId;

    /**
     * 博客，评论
     */
    @TableField("type")
    private String type;

    /**
     * 状态：1.正常，2.取消
     */
    @TableField("status")
    private Integer status;

    public LikesLog(String username, Integer blogId, String blog) {
        this.username = username;
        this.objId = blogId;
        this.type = blog;
        this.status = 1;
    }
}
